package com.yuyuan.notice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuyuan.notice.domain.po.Notice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: kestrel
 * @Version:1.0
 * @Date: 2024/6/20
 */
@Mapper
public interface NoticeMapper extends BaseMapper<Notice> {
    @Select("select * from tb_notices where receive_id = #{userId} and id < #{startId} order by create_time ASC, id ASC limit 6")
    List<Notice> getPageByBlogId(Long userId, Long startId);
    @Select("select max(id) from tb_notices where and receive_id = #{userId} order by id limit 1")
    Long getMaxStartId(Long userId);

}
